<script>
import Form from '@/components/formTable';
import moduleStore from './store';
import Fields from 'field';
export default {
	name: 'searchForm',
	moduleStore,
	mixins: [Form],
	props: {
		hasSlaves: {
			default: false,
		},
		allEnable: {
			default: true,
		},
		autoCol: {
			default: -2,
		},
		stateAll: {
			default: true,
		},
		searchMode: {
			default: true,
		},
	},
	computed: {
		formFields() {
			return this.moduleState.formModel.fields
				.filter(v => {
					//只允许scope both与param 显示
					return v.scope !== 'data' && v.type !== 'pk';
				})
				.sort((a, b) => {
					return a.cardpos - b.cardpos;
				});
		},
	},
	methods: {
		fieldType(field) {
			return Fields.searchFieldType(field, { stateAll: this.stateAll });
		},
	},
};
</script>

